package com.activitycode.datamodel.dazhomgdianping;

import org.json.*;
import java.util.ArrayList;

public class BussinessModel {
	
    private String status;
    private ArrayList<Businesses> businesses;
    private double totalCount;
    private double count;
    
    
	public BussinessModel () {
		
	}	
        
    public BussinessModel (JSONObject json) {
    
        this.status = json.optString("status");

        this.businesses = new ArrayList<Businesses>();
        JSONArray arrayBusinesses = json.optJSONArray("businesses");
        if (null != arrayBusinesses) {
            int businessesLength = arrayBusinesses.length();
            for (int i = 0; i < businessesLength; i++) {
                JSONObject item = arrayBusinesses.optJSONObject(i);
                if (null != item) {
                    this.businesses.add(new Businesses(item));
                }
            }
        }
        else {
            JSONObject item = json.optJSONObject("businesses");
            if (null != item) {
                this.businesses.add(new Businesses(item));
            }
        }

        this.totalCount = json.optDouble("total_count");
        this.count = json.optDouble("count");

    }
    
    public String getStatus() {
        return this.status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public ArrayList<Businesses> getBusinesses() {
        return this.businesses;
    }

    public void setBusinesses(ArrayList<Businesses> businesses) {
        this.businesses = businesses;
    }

    public double getTotalCount() {
        return this.totalCount;
    }

    public void setTotalCount(double totalCount) {
        this.totalCount = totalCount;
    }

    public double getCount() {
        return this.count;
    }

    public void setCount(double count) {
        this.count = count;
    }


    
}
